<div class="container-fluid">
    <div class="block-header">
        <h2>功能管理 > 论坛 > 管理论坛板块</h2>
    </div>
    <div class="row">
        <div class="col-lg-12 col-md-12">
            <div class="card">
                <div class="header">
                    <h2>管理论坛板块</h2>
                </div>
                <div class="body">
                   <div class="table-responsive1">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                      <th>ID</th>
					                  <th>标题</th>
					                  <th>描述</th>
					                  <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php $sections = Wo_GetForumSec(array('forums'=>false, 'limit'=>500000, 'order_by' => 'DESC')) ?>
                             <?php foreach ($sections as $section): ?>
						        <tr data-rmd-section-ident="<?php echo $section['id']; ?>">
						            <td><?php echo $section['id']; ?></td>
						            <td><?php echo $section['section_name']; ?></td>
						            <td><?php echo $section['description']; ?></td>
						            <td>
						                <button class="btn btn-danger delete-section waves-effect waves-light" id="<?php echo $section['id'];?>">
						                    删除
						                </button>
						            </td>
						        </tr>
						    <?php endforeach;?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
    <!-- #END# Vertical Layout -->
<div class="modal fade" id="delete-section">
   <div class="modal-dialog">
      <div class="modal-content modal-col-red">
         <div class="modal-header">
            <h4 class="modal-title"><i class="fa fa-exclamation-circle"></i> 删除板块</h4>
         </div>
         <div class="modal-body">
            <p>您确定要删除此板块吗？</p>
         </div>
         <div class="modal-footer">
            <button  type="button" onclick="Wo_DelForumSection($('#delete-section').attr('data-section-ident'))" class="btn btn-link">删除</button>
            <button  type="button" class="btn btn-link" data-dismiss="modal">取消</button>
         </div>
      </div>
   </div>
</div>
<script>
$(function () {
  $('table').DataTable();
});
$(document).on('click', ".delete-section", function(event) {
    event.preventDefault();
    $("#delete-section").attr('data-section-ident', $(this).attr('id')).modal('show');
});
 function Wo_DelForumSection(id) {
    if (!id) {
        return false;
    } else {
	  $("#delete-section").modal("hide");
      $("[data-rmd-section-ident='" + id + "']").slideUp(function() {
          $(this).remove()
      });
      $.ajax({
          type: "GET",
          url: Wo_Ajax_Requests_File(),
          data: {
              id: id,
              f: 'delete-forum-section'
          },
          dataType: 'json'
      });
    }
}
</script>